package com.github.thinwonton.springboot.showcase.poi.easypoi.entity;

import cn.afterturn.easypoi.excel.annotation.Excel;
import org.hibernate.validator.constraints.NotBlank;

import javax.validation.constraints.Max;
import javax.validation.constraints.Pattern;
import java.util.Date;

/**
 * User
 *
 * @author hugo
 * @date 2018/9/18
 */
public class User {
    @Excel(name = "id")
    @NotBlank(message = "id不能为空")
    private String id;

    @Excel(name = "姓名")
    @Pattern(regexp = "[\\u4E00-\\u9FA5]{2,5}", message = "姓名只支持中文，长度是能2-5位")
    private String name;

    @Max(value = 20, message = "年龄不能超过20")
    @Excel(name = "年龄")
    private Integer age;

    @Excel(name = "创建日期", importFormat = "yyyy-MM-dd HH:mm:ss")
    private Date createTime;

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Integer getAge() {
        return age;
    }

    public void setAge(Integer age) {
        this.age = age;
    }

    public Date getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }
}
